<template>

    <div>
        <el-table :data="List" border style="width: 100%" height="500px">
            <el-table-column fixed prop="" label="序号" width="50">
                <template slot-scope="scope">
                    {{ scope.$index + 1 }}
                </template>
            </el-table-column>
            <el-table-column fixed prop="gid" label="商品编号" width="100"/>-->
                        <el-table-column fixed prop="gname" label="商品名称"/>
                        <el-table-column fixed prop="synopsis" label="商品简介"/>
                        <el-table-column fixed prop="colorid" label="颜色编号" width="100"/>
                        <el-table-column fixed prop="ramid" label="内存编号" width="60"/>
                        <el-table-column fixed prop="gmoney" label="单价" width="60"/>
                        <el-table-column fixed prop="gnumber" label="数量" width="60"/>
                        <el-table-column fixed prop="vendibility" label="可售" width="100"/>
                        <el-table-column fixed prop="photo" label="图片" width="60"/>
                        <el-table-column fixed prop="lock" label="锁定" width="60"/>
                        <el-table-column fixed prop="gstate" label="状态" width="60">
                            <template slot-scope="scope" >
                                <span v-if="scope.row.recordstate === 0" style="color:green">{{scope.row.recordstate === 0?'上架':'下架'}}</span>
                                <span v-else style="color: red">{{scope.row.recordstate === 0?'上架':'下架'}}</span>
                            </template>
                        </el-table-column>

            <el-table-column fixed="right" label="操作" width="170">
                <template slot-scope="scope">
                    <el-button type="text" @click="logFormVisible=true;form=Object.assign({},scope.row)">修改</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    name: 'goods',
    data(){
        return{
            List:[]
        }
    },
    created() {
        this.getList();
    },
    methods:{
        getList() {
            this.$http.post('oppo-back/goods/select?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5OTIwMjAsInVzZXJfbmFtZSI6Inh0eSIsImF1dGhvcml0aWVzIjpbImVwYXNzd29yZD0kMmEkMTAkQVJ5MzdGOWhrQW41LmpWcWtZZXJuT0Uvd29hdndZWWlJZXA0NE5sRVJ4TEhoUjBleWg5NnEiLCJlbmFtZT3lsI_orrgiLCJyb2xlaWQ9bnVsbCIsInBob25lPTE0NDI2Nzg5MzQ2IiwiZXVzZXJuYW1lPXh0eSIsInNleD3lpbMiLCJhdXRob3JpdGllcz1udWxsKSIsIkVtcChlbXBpZD0xIiwicGhvdG89bnVsbCIsInN0YXRlPTAiXSwianRpIjoiOTIzZGE1M2UtMDhjNy00OGYwLTg3ZTQtZTI5MmEwMzg4MThlIiwiY2xpZW50X2lkIjoib3Bwby1iYWNrIiwic2NvcGUiOlsiYWxsIl19.6GSSxFDVlWgA4-xtJlXu7Q33RWIMgNvxjMs9UP1lz1M').then(res => {
                console.log(res)
                this.$data.List = res;
            })
        }
    }
}
</script>

<style scoped>

</style>
